import Vue from 'vue'
import Router from 'vue-router'
import Major from '@/components/Major'
import Login from '@/components/Login/login'
import SA from '@/components/Statistics/Service'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '主页',
      component: Major,
      children:[
        {
          path: '/Customer',
          name: '客户管理',
          icon:'el-icon-s-custom',
          component: resolve => require(['@/components/Customer/index'],resolve),
          children:[
            {
              path: '/Customer/info',
              name: '客服信息',
              icon:'el-icon-s-custom',
              component: resolve => require(['@/components/Customer/info'],resolve)
            },
            {
              path: '/Customer/warning',
              name: '流失预警',
              icon:'el-icon-s-custom',
              component: resolve => require(['@/components/Customer/cusSystem'],resolve)

            },
          ]
        },
        {
          path: '/DD',
          name: '数据字典管理',
          icon:'el-icon-coin',
          component: resolve => require(['@/components/DD/index'],resolve)
        },
        {
          path: '/Marketing',
          name: '营销管理',
          icon:'el-icon-s-shop',
          component: resolve => require(['@/components/Marketing/index'],resolve),
          children:[
            {
              path: '/Marketing/Chance',
              name: '营销机会',
              icon:'el-icon-s-custom',
              component: resolve => require(['@/components/Marketing/chance'],resolve)
            },
            {
              path: '/Marketing/Customer',
              name: '客户开发',
              icon:'el-icon-s-custom',
              component: resolve => require(['@/components/Marketing/customer'],resolve)

            },
          ]
        },
        {
          path: '/Sales',
          name: '销售管理',
          icon:'el-icon-user',
          component: resolve => require(['@/components/Sales/index'],resolve),

        },
        {
          path: '/Service',
          name: '服务管理',
          icon:'el-icon-phone',
          component: resolve => require(['@/components/Service/index'],resolve),
          // children:[
          //   {
          //     path: '/Service/Show',
          //     name: '查看用户',
          //     icon:'el-icon-s-custom',
          //     component: resolve => require(['@/components/Customer/index'],resolve)

          //   },
          //   {
          //     path: '/Service/Edit',
          //     name: '编辑用户s',
          //     icon:'el-icon-s-custom',
          //     component: resolve => require(['@/components/Service/service'],resolve)

          //   },
          // ]
        },
        {
          path: '/Statistics',
          name: '统计数据管理',
          icon:'el-icon-s-marketing',
          component: resolve => require(['@/components/Statistics/index'],resolve)
        },
        {
          path: '/System',
          name: '系统运行管理',
          icon:'el-icon-s-tools',
          component: resolve => require(['@/components/System/index'],resolve)
        },

      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/sa',
      name: 'SA',
      component: SA
    },
  ]
})
